package com.situ.ymall.service.impl;

import com.situ.ymall.mapper.PicMapper;
import com.situ.ymall.service.PicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.swing.text.StyledEditorKit;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Service
public class PicServiceImpl  implements PicService {

    @Autowired
    private PicMapper picMapper;
    @Override
    public List<String> getAll() {

        List<Map<String, String>> piclist = picMapper.selectAll();
        List<String> pics = new ArrayList<>();
        for (Map<String ,String> pic: piclist
             ) {
            if (pic != null)
            pics.add(pic.get("name"));
        }
        return pics;
    }
}
